package com.wen.dao;

import com.wen.pojo.Role;
import com.wen.pojo.Users;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    /**
     * a
     *
     * @param userName
     * @return
     * @throws Exception
     */
    Users findByUserName(String userName) throws Exception;

    /**
     * 查询全部
     *
     * @return
     * @throws Exception
     */
    List<Users> findAll() throws Exception;

    /**
     * @param users
     * @return
     * @throws Exception
     */
    int add(Users users) throws Exception;

    Users findById(int id) throws Exception;

    int deleteById(int id);

    int updateById(Users users);

    List<Role> findOtherRoles(int userId) throws Exception;

    void addRoleToUser(@Param("userId") int userId, @Param("roleId")int roleId);
}
